##################################################################
# Copy right:     Coffee Tech.
# Author:         jiaoyue
##################################################################
#修改此处即可
LIBOBJS += cJSON.o 
LIBOBJS += unix_sock.o 
LIBOBJS += log_utils.o 
LIBOBJS += nv_utils.o 
LIBOBJS += msg_queue.o 
LIBOBJS += msg_queue_peer.o 
LIBOBJS += shmem.o
LIBOBJS += random.o
LIBOBJS += file_opt.o
LIBOBJS += string_opt.o

LIB_SHARED = libhqutils.so

#地址无关
UCFLAGS += -fPIC
ULDFLAGS = -shared
	
$(LIB_SHARED) : $(LIBOBJS)
	#$(CC) $(ULDFLAGS) -o $@ $^	
	$(CC) -o  $@ $^	$(ULDFLAGS)
	cp -d $(LIB_SHARED) $(LIB_DIR)

dep_files := $(foreach f,$(LIBOBJS),.$(f).d)
dep_files := $(wildcard $(dep_files))

ifneq ($(dep_files),)
  include $(dep_files)
endif

$(LIBOBJS):%.o:%.c
	$(CC) -Wp,-MD,.$@.d $(UCFLAGS) $< -o $@

install:
	@echo install platutils

clean:
	rm -rf *.o .*.o.d $(LIB_SHARED)
	rm -rf $(LIB_DIR)/$(LIB_SHARED)
